<template>
	<div class="purchaseProcessingCenterView">
		<div class="cardview">
			<el-card>
				<div slot="header">
					<span class="headerText">隐私协议</span>
				</div>
				<div class="cardview-body">
					<div class="cardview-body-table">
						<quill-editor
							ref="text"
							class="infolistview-info-ifo-edit"
							v-model="infodata"
							:options="editorOption"
						/>
					</div>
					<div style="text-align:right;padding:20px">
						<el-button
							type="primary"
							@click="updata"
						>提交</el-button>
					</div>

				</div>
			</el-card>
		</div>
	</div>
</template>


<script>
	import {
		selectGlobalXieYiById,
		updateGlobaXieYiById,
	} from "../../../api/privacyAgreement";
	import { quillEditor } from "vue-quill-editor";
	import "quill/dist/quill.core.css";
	import "quill/dist/quill.snow.css";
	import "quill/dist/quill.bubble.css";
	export default {
		data() {
			return {
				infodata: null, //全局信息
				editorOption: {
					placeholder: "请输入正文",
				},
			};
		},
		mounted() {
			this.getdata();
		},
		components: {
			quillEditor,
		},
		methods: {
			getdata() {
				let a = {};
				selectGlobalXieYiById(a).then((res) => {
					if (res.code == 200) {
						this.infodata = res.data;
					}
				});
			},
			updata() {
				let a = {
					content: this.infodata,
				};
				updateGlobaXieYiById(a)
					.then((res) => {
						if (res.code == 200) {
							this.$message({
								message: "修改成功",
								type: "success",
                            });
                            this.getdata();
						}
					})
					.catch((err) => {});
			},
		},
	};
</script>


<style lang="less" scoped>
	.purchaseProcessingCenterView {
		// padding: 20px;
		// overflow: auto;
		// height: 83%;

		.headerText {
			font-size: 25px;
			font-weight: bold;
		}

		.cardview-body-table {
			padding: 20px 10px 0 10px;

			.cardview-body-table-title {
				font-size: 20px;
				font-weight: bold;
				padding-top: 20px;
				padding-bottom: 20px;
				border-top: 1px solid #eeeeee;
				border-bottom: 1px solid #eeeeee;
			}
		}

		.cardview-body-changepage {
			padding: 30px 20px 0 0;
			text-align: right;
		}
	}
</style>